<?php
  
  class Connexion
  {
	private $connexion;
	
	public function __construct()
	{}
	
	public function connexionBDD ()
	{
	    $dsn = 'pgsql:host=localhost;dbname=bdd_gestion_projet';
	    $this->connexion = new PDO($dsn, 's_gestion_projet', '9fdrdxp');
	    $this->connexion->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
	    
	    return $this->connexion;
	}
	
	public function fermetureBDD ()
	{
	    $this->connexion = null;
	}
	
	public function getConnexion ()
	{
	    return $this->connexion;
	}
  }
  
?>